

class PrescDetailData {
  Prescription? prescription;
  List<Drugs>? drugs;

  PrescDetailData({this.prescription, this.drugs});

  PrescDetailData.fromJson(Map<String, dynamic> json) {
    if(json["prescription"] is Map) {
      prescription = json["prescription"] == null ? null : Prescription.fromJson(json["prescription"]);
    }
    if(json["drugs"] is List) {
      drugs = json["drugs"] == null ? null : (json["drugs"] as List).map((e) => Drugs.fromJson(e)).toList();
    }
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> _data = <String, dynamic>{};
    if(prescription != null) {
      _data["prescription"] = prescription?.toJson();
    }
    if(drugs != null) {
      _data["drugs"] = drugs?.map((e) => e.toJson()).toList();
    }
    return _data;
  }
}

class Drugs {
  int? id;
  int? drugCount;
  String? usageCount;
  String? usageDays;
  String? timesCount;
  String? usageDosage;
  String? spec;
  double? price;
  String? drugCompany;
  dynamic drugType;
  String? drugName;
  int? drugId;

  Drugs({this.id, this.drugCount, this.usageCount, this.usageDays, this.timesCount, this.usageDosage, this.spec, this.price, this.drugCompany, this.drugType, this.drugName, this.drugId});

  Drugs.fromJson(Map<String, dynamic> json) {
    if(json["id"] is int) {
      id = json["id"];
    }
    if(json["drugCount"] is int) {
      drugCount = json["drugCount"];
    }
    if(json["usageCount"] is String) {
      usageCount = json["usageCount"];
    }
    if(json["usageDays"] is String) {
      usageDays = json["usageDays"];
    }
    if(json["timesCount"] is String) {
      timesCount = json["timesCount"];
    }
    if(json["usageDosage"] is String) {
      usageDosage = json["usageDosage"];
    }
    if(json["spec"] is String) {
      spec = json["spec"];
    }
    if(json["price"] is double) {
      price = json["price"];
    }
    if(json["drugCompany"] is String) {
      drugCompany = json["drugCompany"];
    }
    drugType = json["drugType"];
    if(json["drugName"] is String) {
      drugName = json["drugName"];
    }
    if(json["drugId"] is int) {
      drugId = json["drugId"];
    }
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> _data = <String, dynamic>{};
    _data["id"] = id;
    _data["drugCount"] = drugCount;
    _data["usageCount"] = usageCount;
    _data["usageDays"] = usageDays;
    _data["timesCount"] = timesCount;
    _data["usageDosage"] = usageDosage;
    _data["spec"] = spec;
    _data["price"] = price;
    _data["drugCompany"] = drugCompany;
    _data["drugType"] = drugType;
    _data["drugName"] = drugName;
    _data["drugId"] = drugId;
    return _data;
  }
}

class Prescription {
  int? id;
  String? prescriptionNo;
  double? price;
  int? status;
  String? patientNo;
  String? patientName;
  String? phone;
  String? gender;
  String? idCardNo;
  String? diagnosis;
  String? createTime;
  String? department;
  String? hospName;
  String? doctorNick;
  String? deptNo01;
  String? statusDesc;

  Prescription({this.id, this.prescriptionNo, this.price, this.status, this.patientNo, this.patientName, this.phone, this.gender, this.idCardNo, this.diagnosis, this.createTime, this.department, this.hospName, this.doctorNick, this.deptNo01, this.statusDesc});

  Prescription.fromJson(Map<String, dynamic> json) {
    if(json["id"] is int) {
      id = json["id"];
    }
    if(json["prescriptionNo"] is String) {
      prescriptionNo = json["prescriptionNo"];
    }
    if(json["price"] is double) {
      price = json["price"];
    }
    if(json["status"] is int) {
      status = json["status"];
    }
    if(json["patientNo"] is String) {
      patientNo = json["patientNo"];
    }
    if(json["patientName"] is String) {
      patientName = json["patientName"];
    }
    if(json["phone"] is String) {
      phone = json["phone"];
    }
    if(json["gender"] is String) {
      gender = json["gender"];
    }
    if(json["idCardNo"] is String) {
      idCardNo = json["idCardNo"];
    }
    if(json["diagnosis"] is String) {
      diagnosis = json["diagnosis"];
    }
    if(json["createTime"] is String) {
      createTime = json["createTime"];
    }
    if(json["department"] is String) {
      department = json["department"];
    }
    if(json["hospName"] is String) {
      hospName = json["hospName"];
    }
    if(json["doctorNick"] is String) {
      doctorNick = json["doctorNick"];
    }
    if(json["deptNo01"] is String) {
      deptNo01 = json["deptNo01"];
    }
    if(json["statusDesc"] is String) {
      statusDesc = json["statusDesc"];
    }
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> _data = <String, dynamic>{};
    _data["id"] = id;
    _data["prescriptionNo"] = prescriptionNo;
    _data["price"] = price;
    _data["status"] = status;
    _data["patientNo"] = patientNo;
    _data["patientName"] = patientName;
    _data["phone"] = phone;
    _data["gender"] = gender;
    _data["idCardNo"] = idCardNo;
    _data["diagnosis"] = diagnosis;
    _data["createTime"] = createTime;
    _data["department"] = department;
    _data["hospName"] = hospName;
    _data["doctorNick"] = doctorNick;
    _data["deptNo01"] = deptNo01;
    _data["statusDesc"] = statusDesc;
    return _data;
  }
}